//---------------------------------------------------------------------------

#ifndef CommandProtocolH
#define CommandProtocolH
//---------------------------------------------------------------------------


#define SIZE_COMMAND 64
#define NAME_SERVER  "Command control server"  






class CommandProtocol
{
public:

  CommandProtocol(){}

  mvn_status Init();


  mvn_status Process_Command(void *AContext, AnsiString command);

  mvn_status Process_CommandHTTP(void *AContext,
      TIdHTTPRequestInfo *ARequestInfo, TIdHTTPResponseInfo *AResponseInfo);
  mvn_status Process_CommandHTTP_Post(TIdContext *AContext,
      TIdHeaderList *AHeaders, TStream *&VPostStream);


private:
  bool CreateCamControlObject(int NumCam);
  mvn_status Response_OK(void *AContext);
  bool SelectCamInput(int NumCam);


  AnsiString GetParamValue(TStrings* ParamsData, AnsiString Param);
  AnsiString GetParamHeader(TStrings* ParamsData, AnsiString Param);

  UnicodeString GetListValues(TIdHeaderList *StrList, UnicodeString ReqParam);
  bool CheckNameValues(TIdHeaderList *StrList, UnicodeString ReqParam, UnicodeString ReqValue);

  int CurrentCamZoomSpeed;
  int CurrentCamFocusSpeed;
  int CurrentCamPanTiltSpeed;

  mvn_status Module_cfg(TIdHTTPRequestInfo *RequestInfo, TIdHTTPResponseInfo *ResponseInfo);
  mvn_status Module_avds(TIdHTTPRequestInfo *RequestInfo, TIdHTTPResponseInfo *ResponseInfo);
};









#endif
